package com.zzf.concurrent.example.design.pattern.active.object.client;

import com.zzf.concurrent.example.design.pattern.active.object.ActiveObject;

/**
 * @author GaoFeng2017
 * @date 2019/9/11 15:13
 */
public class PrintStringClientThread extends Thread {

    private ActiveObject activeObject;
    private String text;


    public PrintStringClientThread(ActiveObject activeObject, String text) {
        this.activeObject = activeObject;
        this.text = text;
    }

    @Override
    public void run() {
        for (int i = 1; true; i++) {
            activeObject.printString(text + i);
        }
    }
}
